import 'package:json_annotation/json_annotation.dart';

part 'lessoninfo.g.dart';

@JsonSerializable()

class PreLessonInfo {
  String rangeClassIds;
  String moduleId;
  String contentInfo;
  List<PicList> picList;
  String audioPath;
  String videoPath;

  PreLessonInfo(
      {this.rangeClassIds,
      this.moduleId,
      this.contentInfo,
      this.picList,
      this.audioPath,
      this.videoPath});

  PreLessonInfo.fromJson(Map<String, dynamic> json) {
    rangeClassIds = json['rangeClassIds'];
    moduleId = json['moduleId'];
    contentInfo = json['contentInfo'];
    if (json['picList'] != null) {
      picList = new List<PicList>();
      json['picList'].forEach((v) {
        picList.add(new PicList.fromJson(v));
      });
    }
    audioPath = json['audioPath'];
    videoPath = json['videoPath'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['rangeClassIds'] = this.rangeClassIds;
    data['moduleId'] = this.moduleId;
    data['contentInfo'] = this.contentInfo;
    if (this.picList != null) {
      data['picList'] = this.picList.map((v) => v.toJson()).toList();
    }
    data['audioPath'] = this.audioPath;
    data['videoPath'] = this.videoPath;
    return data;
  }
}

class PicList {
  String name;
  String filePath;
  String moduleDetailId;

  PicList({this.name, this.filePath, this.moduleDetailId});

  PicList.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    filePath = json['filePath'];
    moduleDetailId = json['moduleDetailId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['filePath'] = this.filePath;
    data['moduleDetailId'] = this.moduleDetailId;
    return data;
  }
}
